package com.yexiao.cofe.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yexiao.cofe.business.pojo.ParamValue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface ParamValueMapper extends BaseMapper<ParamValue> {

    @Select("select * from param_value")
    List<ParamValue> listAll();

    @Select("select * from param_value where param_item_id = #{paramItemId}")
    List<ParamValue> listByParamItemId(Integer paramItemId);

    void modifyParamValue(@Param("id") Integer id,
                          @Param("paramItemId") Integer paramItemId,
                          @Param("value") String value,
                          @Param("priceOffset") BigDecimal priceOffset,
                          @Param("stock") Integer stock);
}
